Other Enums

The following enums are available globally.

  • AFError is the error type returned by Alamofire. It encompasses a few different types of errors, each with their own associated reasons.

    • invalidURL: Returned when a URLConvertible type fails to create a valid URL.
    • parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process.
    • multipartEncodingFailed: Returned when some step in the multipart encoding process fails.
    • responseValidationFailed: Returned when a validate() call fails.
    • responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process.
    See more

    Declaration

    Swift

    public enum AFError: Error
  • Used to represent whether a request was successful or encountered an error.

    • success: The request and all post processing operations were successful resulting in the serialization of the provided associated value.

    • failure: The request encountered an error resulting in a failure. The associated values are the original data provided by the server as well as the error that caused the failure.

    See more

    Declaration

    Swift

    public enum Result<Value>
  • The ServerTrustPolicy evaluates the server trust generally provided by an NSURLAuthenticationChallenge when connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust with a given set of criteria to determine whether the server trust is valid and the connection should be made.

    Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with pinning enabled.

    • performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. Applications are encouraged to always validate the host in production environments to guarantee the validity of the server’s certificate chain.

    • pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. By validating both the certificate chain and host, certificate pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments.

    • pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. By validating both the certificate chain and host, public key pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments.

    • disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid.

    • customEvaluation: Uses the associated closure to evaluate the validity of the server trust.

    See more

    Declaration

    Swift

    public enum ServerTrustPolicy
  • BrowseState holds the state of an entire list and not individual items. - failure: Failed to load, holds a reload function to retry. - success: Succeeded to load its request.

    Declaration

    Swift

    public enum BrowseState
  • AFIError is the error type returned by AlamofireImage.

    • requestCancelled: The request was explicitly cancelled.
    • imageSerializationFailed: Response data could not be serialized into an image.
    See more

    Declaration

    Swift

    public enum AFIError: Error